package com.wnxy.sddfp.common;

import com.wnxy.sddfp.common.util.JwtTemplate;

import java.util.HashMap;
import java.util.Map;

public class JwtDemo2 {
    public static void main(String[] args) {
        Map<String,Object> payload = new HashMap<>();
        payload.put("id","1000");
        payload.put("name","Jack");

        // 生成token
        JwtTemplate jwtTemplate = new JwtTemplate();
        String token = jwtTemplate.createToken(payload);
        System.out.println("token = " + token);

        // 校验token
        System.out.println("jwtTemplate.verify(token) = " + jwtTemplate.verify(token));
    }
}
